package com.java.manage.controller;

import com.java.common.model.Result;
import com.java.manage.model.Company;
import com.java.manage.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * 门店
 */
@RestController
@RequestMapping("/company")
public class CompanyController {

    @Autowired
    private CompanyService companyService;

    @PostMapping("/list")
    public Result list(@RequestBody Company company, HttpServletRequest request) {
        return companyService.list(company,request);
    }

    @PostMapping("/save")
    public Result save(@RequestBody Company company) {
        return companyService.save(company);
    }

    @PostMapping("/modify")
    public Result modify(@RequestBody Company company) {
        return companyService.modify(company);
    }

    @PostMapping("/remove")
    public Result remove(int[] ids) {
        return companyService.remove(ids);
    }

    /**
     * 查询类型
     * @return
     */
    @PostMapping("/listAll")
    public Result listAll() {
        return companyService.listAll();
    }


}
